const {readJson} = require('../../until/fs');
const {SHOP_JSON} = require('../../config/config.data');

let getShopList = (req,res) =>{

    const {city,area} = req.body
    let shopData = readJson(SHOP_JSON)
        shopData = shopData.filter(item=>item.city.includes(city))

    // 区域不为空
    if(area!==''){
        shopData = shopData.filter(item=>item.area.includes(area))
    }

    res.send({code:1,msg:"店铺列表数据",data:shopData})

}

module.exports = {
    getShopList
}